home *** CD-ROM | disk | FTP | other *** search
- <HTML xmlns:CogTracker="http://www.rword.ru/tracker/">
- <HEAD>
- <TITLE>
- Cogitum Co-Citer
- </TITLE>
-
-
-
- <HTA:APPLICATION
- ID="oHTA"
- APPLICATIONNAME="{E0F6716F-4E84-11d4-B7AB-00C0F04903DC}"
- CAPTION="yes"
- ICON="CogTracker16x16.ico"
- MAXIMIZEBUTTON="yes"
- MINIMIZEBUTTON="yes"
- SHOWINTASKBAR="yes"
- SINGLEINSTANCE="yes"
- SYSMENU="yes"
- VERSION="1.0.4"
- WINDOWSTATE="minimize"
- >
- </HTA:APPLICATION>
-
-
-
-
-
- <LINK rel="stylesheet" type="text/css" href="CogTrackerNew.css"/>
- <LINK rel="stylesheet" type="text/css" href="CogTrackerTree.css"/>
-
-
- <SCRIPT LANGUAGE="JScript">
- // 1 means sense support on
- // 2 means tracker support on
- // 4 means bannerpile database support
- @set @support = 8;
- </SCRIPT>
-
- <SCRIPT LANGUAGE="JScript">
- // 1 means sense support on
- // 2 means tracker support on
- @if ( @support != @support)
- @set @support = 1;
- @end
- @set @SenseSupport = ( (@support) == 1);
- @set @TrackerSupport = ( (@support) == 2);
- @set @BannerPileSupport = ( (@support) == 4);
- @set @CitatesSupport = ( (@support) == 8);
-
- </SCRIPT>
-
-
- <SCRIPT LANGUAGE="JScript" SRC="CogTracker.js">
- </SCRIPT>
-
-
- <SCRIPT LANGUAGE="JScript" SRC="ctUtils.js">
- </SCRIPT>
- <SCRIPT LANGUAGE="JScript" SRC="String.js">
- </SCRIPT>
- <SCRIPT LANGUAGE="JScript" SRC="XMLBaseIO.js">
- </SCRIPT>
-
-
- <STYLE>
- @media print {
- FRAME.NotPrintable {
- display: none;
- page-break-before: "";
- page-break-after: "";
- };
- }
- </STYLE>
- <!-- /HEAD -->
-
-
- <!-- Auto-resize development delayed -->
- <!--
- <SCRIPT LANGUAGE="JScript">
- var nResizeTimerID = -1;
- function OnResize() {
- if (nResizeTimerID != -1) {
- window.clearTimeout(nResizeTimerID);
- nResizeTimerID = -1;
- OnFolderChanged();
- };
- };
- </SCRIPT>
- <SCRIPT LANGUAGE="JScript" FOR="window" EVENT="onresize">
- nResizeTimerID = window.setTimeout("OnResize()", 500);
- </SCRIPT>
- -->
- <SCRIPT LANGUAGE="JScript">
- L_FoldersTreeButton_Hide = "Hide Folders Tree Pane";
- L_FoldersTreeButton_Show = "Show Folders Tree Pane";
- L_NO_HELPER = "There are no Cogitum Helper object found.\n\nYou may need to reinstall the application.";
-
- var bWontWork = false;
-
- function fnGetMainToolbar() {
- return document.frames.ctToolBars.document.all.ctMainToolbar;
- };
- function fnGetLeftToolbar() {
- return document.frames.ctToolBars.document.all.ctLeftToolbar;
- };
- function fnGetRightToolbar() {
- return document.frames.ctToolBars.document.all.ctRightToolbar;
- };
- function fnGetTreeHolder() {
- return document.frames.ctLeftFrame.document.all.ctlTree;
- };
- function fnGetCitatesHolder() {
- return document.frames.ctRightFrame.document.all.ctlCitates;
- };
-
- function fnGetHelperObject() {
- return document.frames.ctToolBars.document.idHelper;
- };
-
- var bLeftFrameLoaded = false;
-
- function fnSetupLeftFrame() {
- if (bWontWork)
- return;
-
- if (bLeftFrameLoaded) { // User selected Refresh from LeftFrame's context menu
- fnLoadFile(gsCurrentPath);
- };
-
- bLeftFrameLoaded = true;
- };
-
- var bRightFrameLoaded = false;
-
- function fnSetupRightFrame() {
- if (bWontWork)
- return;
-
- if (bRightFrameLoaded) { // User selected Refresh from RightFrame's context menu
- OnFolderChanged();
- };
-
- bRightFrameLoaded = true;
- };
-
- var TitleBarSetupTimer = -1;
- // Called from fnDoStartup and from TitleBar's onload.
- // Reason: user can select Refresh from TitleBar's popup menu.
- function fnSetupTitleBar() {
- if (bWontWork)
- return;
-
-
- if (TitleBarSetupTimer != -1) {
- window.clearTimeout(TitleBarSetupTimer);
- TitleBarSetupTimer = -1;
- };
-
- try {
- document.frames.ctTitleBar.document.all.idVersionString.innerHTML =
- "Version " + top.oHTA.version + " ";
-
- }
- catch(err) { // Error occured. retry later.
- TitleBarSetupTimer = window.setTimer(fnSetupTitleBar, 50);
- };
- };
-
- var ToolBarSetupTimer = -1;
-
- function fnGetBrowserVersion() {
- var sAgent = window.navigator.userAgent;
- var nPos = sAgent.indexOf("(");
- if (nPos > -1) {
- sAgent = sAgent.slice(nPos+1);
- };
- nPos = sAgent.search(/\d/g);
- if (nPos > -1) {
- var nVersion = parseFloat(sAgent.slice(nPos));
- if (!isNaN(nVersion)) {
- return nVersion;
- };
- };
-
- return 0.0;
-
- };
-
- // Called from fnDoStartup and from ToolBar's onload.
- // Reason: user can select Refresh from ToolBar's popup menu.
- function fnSetupToolBar() {
- if (bWontWork)
- return;
-
- if (ToolBarSetupTimer != -1) {
- window.clearTimeout(ToolBarSetupTimer);
- ToolBarSetupTimer = -1;
- };
-
- try {
- // Setup Sorting modes
- // Note: we store (SortBy + 1) and (SortDirection + 1)
- // in the registry. This helps detect absence of
- // the setting in it.
-
- var nSortBy = -1;
- if (gnSortBy != -1) {
- nSortBy = gnSortBy + 1;
- }
- else {
- nSortBy = fnGetSetting(ccsSortBy, 0, true);
- }
-
- if (nSortBy == null || isNaN(nSortBy))
- nSortBy = 1;
- else
- nSortBy --;
-
-
- if (nSortBy < 0 || nSortBy >= arAttributeNames.length)
- nSortBy = 1;
- gnSortBy = nSortBy;
-
-
- var nSortDirection = -1;
- if (gnSortDirection != -1) {
- nSortDirection = gnSortDirection + 1;
- }
- else {
- nSortDirection = fnGetSetting(ccsSortDirection, 0, true);
- };
-
- if (nSortDirection == null || isNaN(nSortDirection))
- nSortDirection = 1;
- else
- nSortDirection --;
-
- if (nSortDirection < 0 || nSortDirection >= arDirectionSigns.length)
- nSortDirection = 1;
- gnSortDirection = nSortDirection;
-
-
- var oRightButtons = fnGetRightToolbar().childNodes;//RightToolbar.childNodes;
- for ( i = 0; i < oRightButtons.length; i++) {
- if ( ( oRightButtons[i].tagName == "IMG" ) &&
- ( oRightButtons[i].className == "ToolbarButton" )) {
-
- oRightButtons[i].ct_disabled = 0;
- //oRightButtons[i].ct_checkbutton = 1;
- oRightButtons[i].ct_state = 0;
- //oRightButtons[i].tabIndex=1;
- };
- };
-
- var oLeftButtons = fnGetLeftToolbar().childNodes;//LeftToolbar.childNodes;
- for ( i = 0; i < oLeftButtons.length; i++) {
- if ( ( oLeftButtons[i].tagName == "IMG" ) &&
- ( oLeftButtons[i].className == "ToolbarButton" )) {
-
-
- oLeftButtons[i].ct_disabled = 0;
- //oLeftButtons[i].ct_checkbutton = 0;
- oLeftButtons[i].ct_state = 0;
-
- }
- };
-
- if (fnGetBrowserVersion() >= 5.5) {
- var oButtons = fnGetMainToolbar().childNodes;
- for ( i = 0; i < oButtons.length; i++) {
- if ( ( oButtons[i].tagName == "IMG" ) &&
- ( oButtons[i].className == "ToolbarButton" )) {
-
- oButtons[i].tabIndex = -1;
- };
- };
- oButtons = fnGetLeftToolbar().childNodes;
- for ( i = 0; i < oButtons.length; i++) {
- if ( ( oButtons[i].tagName == "IMG" ) &&
- ( oButtons[i].className == "ToolbarButton" )) {
-
- oButtons[i].tabIndex = -1;
- };
- };
- oButtons = fnGetRightToolbar().childNodes;
- for ( i = 0; i < oButtons.length; i++) {
- if ( ( oButtons[i].tagName == "IMG" ) &&
- ( oButtons[i].className == "ToolbarButton" )) {
-
- oButtons[i].tabIndex = -1;
- };
- };
- };
-
-
- fnSortBy(-1, -1, //arButtonSortNames[gnSortBy], gnSortDirection,
- false);
- }
- catch(err) { // Error occured. retry later.
- ToolBarSetupTimer = window.setTimer(fnSetupToolBar, 50);
- };
-
- };
-
- function fnFindParameter(someString, someNumber) {
-
- var oRes = new Array();
- var bInQuotes = false;
- var nElement = 0;
- oRes[0] = new String();
-
- for (var i = 0; i < someString.length; i++) {
- if (bInQuotes) {
- if (someString.charAt(i) == '"') {
- bInQuotes = false;
- }
- else {
- oRes[nElement] += someString.charAt(i);
- };
- }
- else {
- if (someString.charAt(i) == '"') {
- bInQuotes = true;
-
- if (oRes[nElement] == null) {
- oRes[nElement] = new String();
- }
- else
- if (oRes[nElement] != "") {
- nElement ++;
- oRes[nElement] = new String();
- };
- }
- else if (someString.charAt(i) == ' ') {
- if (oRes[nElement] == null) {
- oRes[nElement] = new String();
- }
- else
- if (oRes[nElement] != "") {
- nElement ++;
- oRes[nElement] = new String();
- };
- }
- else {
- if (oRes[nElement] == null) {
- oRes[nElement] = new String();
- };
- oRes[nElement] += someString.charAt(i);
- }
- };
- };
-
- if (someNumber > 0 && someNumber < oRes.length) {
- return oRes[someNumber];
- }
- else {
- return null;
- };
- };
-
- function fnDoStartup() {
- var Helper = fnGetHelperObject();
- try {
- Helper.DoRevokeDragDrop();
- }
- catch(err) {
- // Turn off waiting SetUps
-
- if (ToolBarSetupTimer != -1) {
- window.clearTimeout(ToolBarSetupTimer);
- ToolBarSetupTimer = -1;
- };
- if (TitleBarSetupTimer != -1) {
- window.clearTimeout(TitleBarSetupTimer);
- TitleBarSetupTimer = -1;
- };
-
- // Turn off onload handlers
- for (var i = 0; i < document.frames.length; i++) {
- var curFrame = document.frames.item(i);
- if (curFrame.document.body.onload != null &&
- curFrame.document.body.onload != "") {
-
- curFrame.document.body.onload = "";
- };
- };
-
- bWontWork = true;
- alert(L_NO_HELPER);
- window.close();
- return;
- };
-
-
- // Setup Splitter width
- fnRestoreSplitterPosition();
- //
-
- fnSetupTitleBar();
-
- Helper.DoBroadcastCloseSplash();
- Helper.RestoreWindowPos( ccsModule, ccsWindowPos, oHTA.applicationName);
-
-
- fnResizeTitleBar();
-
- fnLoadSettings();
-
- fnSetupToolBar();
-
- var sCommandLinePath = fnFindParameter(oHTA.commandLine, 1);
-
- var sLastFile = "";
- if (sCommandLinePath == "" || sCommandLinePath == null) {
- sLastFile = fnGetSetting(ccsStLastFile, "", false);
- }
- else {
- sLastFile = sCommandLinePath;
- };
-
- if (sLastFile == "")
- sLastFile = null;
-
-
- fnLoadFile(sLastFile, (sCommandLinePath == sLastFile && sLastFile != null) );
-
- };
- var nLastClientWidth = 0;
- function fnResizeTitleBar() {
- if (bWontWork)
- return;
-
- if (nLastClientWidth != ctTitleBar.document.body.clientWidth) {
-
-
- idMainFrameSet.rows =
- //(ctTitleBar.document.body.clientWidth * 50.0 / 1024.0) +
- "38" +
- "," +
- (ctToolBars.document.body.scrollHeight).toString() +
- ",*";
-
- };
-
-
- };
-
-
-
- function fnCalcLeftFrameWidth() {
- var nScreenWidth = (ctRightFrame.document.parentWindow.screenLeft -
- ctLeftFrame.document.parentWindow.screenLeft);
- if (nScreenWidth < 8) {
- nScreenWidth = 0;
- };
- nScreenWidth = Math.min(ctLeftFrame.document.body.clientWidth,
- nScreenWidth);
- return nScreenWidth;
- };
-
- function fnIsFolderTreeVisible() {
-
- return (fnCalcLeftFrameWidth() > 0);
-
- };
-
- function fnSynchronizeShowHideFoldersTreeButton() {
- var tbButton = fnGetLeftToolbar().all.ctsFoldersTreeShowHide;
-
- var bFoldersTreeVisible = //( parseInt(idVerticalFrameSet.cols.slice(0,1)) != 0);
- //(ctLeftFrame.document.body.clientWidth > 0);
- //ctRightFrame.document.parentWindow.screenLeft -
- //ctLeftFrame.document.parentWindow.screenLeft
- fnIsFolderTreeVisible();
-
-
- if (bFoldersTreeVisible) {
- tbButton.alt = L_FoldersTreeButton_Hide;
- tbButton.src = "FolderTreeHide_g.gif";
- tbButton.activesrc = "FolderTreeHide.gif";
- tbButton.graysrc = "FolderTreeHide_g.gif";
- }
- else {
- tbButton.alt = L_FoldersTreeButton_Show;
- tbButton.src = "FolderTreeShow_g.gif";
- tbButton.activesrc = "FolderTreeShow.gif";
- tbButton.graysrc = "FolderTreeShow_g.gif";
- };
- };
-
- function fnToggleShowHideFoldersTree() {
- // var tbButton = fnGetLeftToolbar().all.ctsFoldersTreeShowHide;
-
- var bFoldersTreeVisible = //( parseInt(idVerticalFrameSet.cols.slice(0,1)) != 0);
- //(ctLeftFrame.document.body.clientWidth > 0);
- fnIsFolderTreeVisible();
-
- if (bFoldersTreeVisible)
- fnOnSplitterMove(); // Save current percents
-
- bFoldersTreeVisible = !bFoldersTreeVisible;
-
- if (bFoldersTreeVisible) {
-
- fnSetSetting(ccsLeftPaneHidden,
- 0,
- true);
-
- }
- else {
- fnSetSetting(ccsLeftPaneHidden,
- 1,
- true);
-
- };
-
- fnRestoreSplitterPosition();
-
- };
-
-
-
- function fnRestoreSplitterPosition() {
- if (bWontWork)
- return;
-
-
- // Setup Splitter width
- var bLeftPaneHidden = fnGetSetting(ccsLeftPaneHidden, 0, true);
-
- if ( ! bLeftPaneHidden ) {
-
- var nLeftPanePercent = fnGetSetting(ccsLeftPanePercent, 0, true);
- if (nLeftPanePercent == null ||
- isNaN(nLeftPanePercent) ||
- nLeftPanePercent <= 0 ||
- nLeftPanePercent >= 9800) {
-
-
- nLeftPanePercent = 20;
- }
- else
- nLeftPanePercent /= 100.0;
-
- if (fnGetBrowserVersion() >= 5.5) {
- nLeftPanePercent += 0.2;
- }
- else {
- nLeftPanePercent -= 0.2;
- };
-
- idVerticalFrameSet.cols = nLeftPanePercent.toString() + "%,*";
- }
- else {
- idVerticalFrameSet.cols = "0%,*";
- };
- //
-
- fnSynchronizeShowHideFoldersTreeButton();
- };
-
- function fnOnSplitterMove() {
-
- //ctTitleBar.document.all.idVersionString.innerText =
- // ctLeftFrame.document.body.clientWidth + ":" + ctRightFrame.document.body.clientWidth;
- //ctLeftFrame.offsetWidth + ":" + ctRightFrame.offsetWidth;
- //ctLeftFrame.width + ":" + ctRightFrame.width;
- //ctLeftFrame.document.parentWindow.screenLeft + ":" +ctRightFrame.document.parentWindow.screenLeft + "::" +
- //ctLeftFrame.document.body.clientWidth + ":" + ctRightFrame.document.body.clientWidth;
-
- if ( (ctLeftFrame.document.body.clientWidth +
- ctRightFrame.document.body.clientWidth) > 10 ) {
-
- var nLeftFrameWidth = fnCalcLeftFrameWidth();
- if (nLeftFrameWidth > 0)
- nLeftFrameWidth -= 0;
- var nLeftPanePercent = Math.round(
- (/*ctLeftFrame.document.body.clientWidth*/
- nLeftFrameWidth * 10000.0) /
- (/*ctLeftFrame.document.body.clientWidth*/
- nLeftFrameWidth +
- ctRightFrame.document.body.clientWidth + 4)
- );
-
- if (nLeftPanePercent > 0) {
- fnSetSetting(ccsLeftPanePercent,
- nLeftPanePercent,
- true);
- };
-
- fnSetSetting(ccsLeftPaneHidden,
- //!(nLeftPanePercent > 0) ,
- !fnIsFolderTreeVisible(),
- true);
- };
-
- fnSynchronizeShowHideFoldersTreeButton();
- };
-
- function fnDoShutdown() {
-
- if (bWontWork)
- return;
-
- var bLocked = false;
-
- try { // Save Currently selected folder w/o notifications/stamp change...
- // Ignore errors, as this is not critical.
-
- if (gsCurrentPath == "" || gsCurrentPath == null || goCurrentFolderUIN == -1) {
- throw "ERR0";
- };
-
- fnGetHelperObject().LockFile(gsCurrentPath);
- bLocked = true;
-
- var oDiskBase = fnCreateXMLctl();
- if (oDiskBase == null) {
- throw "ERR1";
- };
-
- if (oDiskBase.load(gsCurrentPath)){
- if (oDiskBase.selectSingleNode("//*[@UIN='" + goCurrentFolderUIN + "']") ) {
-
- var ctDATABASE = oDiskBase.selectSingleNode("/root/CogTracker:ctDATABASE");
- if (ctDATABASE != null) {
- if (ctDATABASE.getAttribute(cxbiAttCurrentNode) != goCurrentFolderUIN) {
-
- ctDATABASE.setAttribute(cxbiAttCurrentNode, goCurrentFolderUIN);
-
- oDiskBase.save(gsCurrentPath);
- };
- };
- };
-
- };
- }
- catch(err) {
- };
- try {
- if (bLocked) {
- fnGetHelperObject().UnlockFile(gsCurrentPath);
- };
- }
- catch(err) {
- };
-
- try { // Helper can be absent, catch all...
- var Helper = fnGetHelperObject();
- Helper.SaveWindowPos( ccsModule, ccsWindowPos, oHTA.applicationName);
-
- fnSaveSettings();
- }
- catch(err) {
- };
-
- };
- </SCRIPT>
-
- <SCRIPT FOR=document EVENT="onhelp">
- top.fnShowHelp();
- window.event.cancelBubble = true;
- window.event.returnValue = false;
- </SCRIPT>
-
- </HEAD>
-
- <FRAMESET ROWS="38,24,*" FRAMEBORDER="yes" BORDER="1" id="idMainFrameSet"
- MARGINWIDTH="0" MARGINHEIGHT="0" FRAMESPACING="0"
- onload="fnDoStartup();"
- onbeforeunload="fnDoShutdown()"
- xxonbeforeprint="alert('before'); event.returnValue = false; return false;"
- oncontextmenu="event.cancelBubble=true; event.returnValue=false; return false;"
- >
-
-
- <FRAME APPLICATION="yes" SRC="ctTitleBar.htm" id="ctTitleBar"
- SCROLLING="NO" Class="NotPrintable"
- NORESIZE="1"
- FRAMEBORDER="no" MARGINWIDTH="0" MARGINHEIGHT="0"
- onresize="fnResizeTitleBar()"
- TABINDEX="-1"/>
-
- <FRAME APPLICATION="yes" SRC="ctToolBars.htm" id="ctToolBars"
- SCROLLING="NO" Class="NotPrintable"
- NORESIZE="1"
- FRAMEBORDER="no" MARGINWIDTH="0" MARGINHEIGHT="0"
- TABINDEX="-1"/>
-
- <FRAMESET COLS="20%,*" FRAMEBORDER="yes" BORDER="5" FRAMESPACING="2"
- id="idVerticalFrameSet"
- oncontextmenu="event.cancelBubble=true; event.returnValue=false; return false;"
- >
-
- <FRAME APPLICATION="yes" SRC="ctLeftFrame.htm"
- id="ctLeftFrame" SCROLLING="YES"
- onresize="fnOnSplitterMove()"
- FRAMEBORDER="yes" TABINDEX="-1"/>
-
- <FRAME APPLICATION="yes" SRC="ctRightFrame.htm"
- id="ctRightFrame" SCROLLING="YES"
- FRAMEBORDER="yes" TABINDEX="-1"/>
- </FRAMESET>
- </FRAMESET>
- </HTML>
-